<template>
  <el-container>
    <el-header>
      添加菜品：<el-button type="success" circle icon="el-icon-plus" @click="addDialogVisible=true"></el-button>
      <el-table :data="Cuisine" style="width: 100%">
                <el-table-column prop="cuisineName" label="菜品名">
                </el-table-column>
                <el-table-column prop="cuisineImg" label="图片">
                </el-table-column>
                <el-table-column prop="cuisinePrice" label="价格">
                </el-table-column>
                <el-table-column prop="cuisineTypeId" label="菜品类型" v-if="cuisineTypeId=1">
                  素菜
                </el-table-column>
                <el-table-column prop="cuisineTypeId" label="菜品类型" v-if="cuisineTypeId=2">
                  荤菜
                </el-table-column>
                <el-table-column prop="cuisineTypeId" label="菜品类型" v-if="cuisineTypeId=3">
                  酒水
                </el-table-column>
                <el-table-column prop="cuisineIntroduce" label="菜品介绍">
                </el-table-column>
                <el-table-column fixed="right" label="修改" width="100">
                  <template slot-scope="scope">
                    <el-button @click="upCuisine(scope.row)" type="text" size="small">编辑</el-button>
                    <el-button @click="delCuisine(scope.row)" type="text" size="small">删除</el-button>
                  </template>
                </el-table-column>
            </el-table>
<el-dialog title="添加菜品" :visible.sync="addDialogVisible" width="30%">
            <el-form v-model="addForm" class="demo-form-inline">
              <el-form-item label="菜品名">
                <el-input v-model="addForm.cuisineName" placeholder="请输入菜品名"></el-input>
              </el-form-item>
              <el-form-item label="菜品图片">
                <el-file v-model="addForm.cuisineImg" placeholder="请上传菜品图片"></el-file>
              </el-form-item>
              <el-form-item label="菜品价格">
                <el-input v-model="addForm.cuisinePrice" placeholder="请输入菜品价格"></el-input>
              </el-form-item>
              <el-form-item label="菜品介绍详情">
                <el-textarea v-model="addForm.cuisineIntroduce" placeholder="请写入菜品介绍"></el-textarea>
              </el-form-item>
              <el-form-item label="菜品类型">
                    <el-select v-model="addForm.cuisineTypeId" placeholder="选择类型">
                        <el-option label="素菜" value="1"></el-option>
                        <el-option label="荤菜" value="2"></el-option>
                        <el-option label="酒水" value="3"></el-option>
                    </el-select>
              </el-form-item>
              <el-form-item>
                    <el-button @click="addDialogVisible = false">取 消</el-button>
                    <el-button type="primary" @click="addCuisine">确 定</el-button>    
              </el-form-item>
            </el-form>
        </el-dialog>
 </el-header>
  <el-main>
  </el-main>
  <el-footer>
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="page.current"
      :page-size="page.size"
      layout="total, sizes, prev, pager, next, jumper"
      :total="page.total">
    </el-pagination>
  </el-footer>
  </el-container>
  </template>
<script>
export default {
  data() {
    
  },
  }
  </script>
  